package com.tang.sharding.schedule.config;

import lombok.Getter;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

/**
 * @author Tang
 * @classname ScheduleConfig
 * @description [  ]
 * @date 2021/8/1 16:29
 */
public class DefaultScheduleConfigurer {

    @Getter
    private static ScheduledTaskRegistrar scheduledTaskRegistrar = new ScheduledTaskRegistrar();

    static {
        // 注册线程池
        DefaultScheduleConfigurer.scheduledTaskRegistrar.setTaskScheduler(new DefaultThreadPoolTaskScheduler(20,
                "my-threadPoolTaskScheduler-"));
    }

}